home *** CD-ROM | disk | FTP | other *** search
- Path: goanna.cs.rmit.EDU.AU!not-for-mail
- From: ok@goanna.cs.rmit.EDU.AU (Richard A. O'Keefe)
- Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2
- Subject: Integer coding (was Re: Hungarian notation - whoops!)
- Date: 15 Feb 1996 15:24:20 +1100
- Organization: Comp Sci, RMIT, Melbourne, Australia
- Message-ID: <4fuchk$phu@goanna.cs.rmit.EDU.AU>
- References: <30C40F77.53B5@swsbbs.com> <Pine.HPP.3.91.960124153551.24374C-100000@zeezrom.cs.byu.edu> <4e7ifl$et3@goanna.cs.rmit.EDU.AU> <Pine.HPP.3.91.960129133429.8419C-100000@foggy.cs.byu.edu> <4em29qINN39r@keats.ugrad.cs.ubc.ca> <Pine.HPP.3.91.960201015336.17360C-100000@clear.cs.byu.edu> <4f41vf$g8j@goanna.cs.rmit.EDU.AU> <Pine.HPP.3.91.960205124102.18647E-100000@warm.cs.byu.edu> <4fc157$jsf@goanna.cs.rmit.EDU.AU> <1996Feb8.130010.27570@friend.kastle.com> <dewar.824060370@schonberg>
- NNTP-Posting-Host: goanna.cs.rmit.edu.au
- X-Newsreader: NN version 6.5.0 #0 (NOV)
-
- dewar@cs.nyu.edu (Robert Dewar) writes:
-
- >Incidentally, I asked for verification of the surprising claim that there
- >is a currently manufactured mainframe that uses sign+magnitude representation
- >for integers. No one has verified this, and I think the claim is bogus,
- >probably based on confusion with fpt, or some other confusion.
-
- But I *did* respond. According to postings in comp.arch, the architectural
- line begun by the Burroughs B6500 is still alive and well. I don't know what
- the current model is, is it the A19? Something like that.
-
- >I would be delighted if someone would prove me wrong on this, it would be
- >a nice example of ancient, and clearly inferior, technology, surviving.
-
- It is not at all "clear" that the technology is inferior.
- Representational adequacy: in Ada terms
- type B6700_Short_Integer is -(2**39-1) .. (2**39-1);
- type B6700_Long_Integer is -(2**78-1) .. (2**78-1);
- type B6700_Short_Float is digits 11;
- type B6700_Long_Float is digits 23;
- What it provided was perfectly adequate for Fortran (I have noticed nothing
- in the Fortran 90 standard that it couldn't handle), Pascal (again, I have
- noticed nothing in the ISO Pascal Extended standard that it couldn't handle),
- Algol, PL/I (as it stood at the time; IBM PL/I for OS/2 has unsigned), Lisp
- (yes, there was a Lisp), Simula, and SNOBOL (the SNOBOL system was actually
- the standard SIL implementation of SNOBOL macro-expanded by the Algol
- compiler to Algol).
-
- By the way, you don't need unsigned arithmetic to do bit twiddling.
- The machine had the usual set of bit-wise operations plus bitfield extraction
- and insertion.
-
- It should be "clear" that sign and magnitude representation for integers is
- if anything better for multiplication and division (assuming the Algol 60
- definition for div and mod, and I know that's not always best) and should
- be the same for comparison. It should also be "clear" that converting
- between 2s complement and sign-and-magnitude representation can be done as
- fast as an add or faster, so an add or subtract could be at most three times
- slower than a 2s complement add or subtract. A little thought improves the
- bound to two times slower. I am not skilled at computer architecture, but
- it seems "clear" to me that a single-cycle sign-and-magnitude add/subtract is
- acheivable with something between 100% and 200% of the area of a 2s-complement
- one, and I reckon it's closer to the 100% end.
-
- Let's put this in perspective. From last year's ASPLOS:
- CPU speeds increase by 40% a year
- but main memory speeds have improved by only a factor of 10
- over the last decade, while processor speeds are up by 100
- Primary cache miss penalties are around 20 cycles,
- but are soon expected to be around 100.
-
- A floating-point add can be done in 2 cycles.
- A 3 cycle unit saves a fair bit of area.
-
- If a floating-point add, which requires alignment and normalisation, can
- be done in 2 cycles, surely an integer sign-and-magnitude add can be done
- in 1 cycle, and in any case, that's not the main bottleneck any more.
-
- What *really* counts in today's technology is trying to cope with the gap
- between processor speeds and memory speeds. The representation of integers
- has no effect that I can see on that, and should have no effect on overall
- system performance. Apparently the current A series machines are quite
- adequate for financial transaction processing.
-
- If a computing technology is to count as "clearly inferior" because it doesn't
- easily support C, then heaven help us.
- --
- Election time; but how to get Labour _out_ without letting Liberal _in_?
- Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.
-